package de.hdu.pms.ho.ctrl;


import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**{@link HomeController} is needed for the WebInterface, which will opened in browser.
 * 
 * @author Hendrik Neumann
 *
 */
@Controller
public class HomeController {
	private static Logger Log = Logger.getLogger(HomeController.class);
	
/*	@RequestMapping(value="/index.html")
	public String home(){
		Log.debug("Home wurde gestartet");
		return "";
	} */
	
	/**
	 * The edit() method starts the index.html and generates
	 * the necessary objects for neater information in the view sites.
	 * The edit() method is for the customer menu.
	 * 
	 * @return
	 */
	@RequestMapping(value="/index.html")
    public ModelAndView edit() {
    	Log.info("welcome");
		ModelAndView mv = new ModelAndView();
		mv.addObject("title", "Herzlich Willkommen!");
		mv.addObject("message", "...in der Hotelverwaltung der Projektgruppe Feig.");
		mv.addObject("message2", "Wir wünschen einen angenehmen Aufenthalt.");
		mv.setViewName("open/home");
		return mv;
    }
	
	/**
	 * The edit2() method starts the index2.html and generates
	 * the necessary objects for neater information in the view sites.
	 * The edit2() method is for the personal menu.
	 * @return
	 */
	@RequestMapping(value="index2.html")
    public ModelAndView edit2() {
    	Log.info("welcome");
		ModelAndView mv = new ModelAndView();
		mv.addObject("title", "Administration und Verwaltung!");
		mv.addObject("message", "Verwalten Sie Kundendaten, Personaldaten, " +
				"Zimmerreservierungen und Zimmerkategorien");
		mv.setViewName("protected/home2");
		return mv;
    }
	/**
	 * The method login() generates a login object for switching in personal view
	 * 
	 * @return
	 */
	@RequestMapping(value="login.html")
	public ModelAndView login(){
		Log.info("Login");
		ModelAndView mv = new ModelAndView();
		mv.addObject("title", "Login");
		mv.addObject("message", "Loggen Sie sich mit Ihren Daten ein!");
		mv.setViewName("/protected/login");
		return mv;
	}
	
	/**
	 * The kontakt() method opens the google maps function in a object
	 * 
	 * @return
	 */
	@RequestMapping(value="/kontakt.html")
	public ModelAndView kontakt() {
		Log.info("kontakt");
		ModelAndView mv = new ModelAndView();
		mv.addObject("title", "Unser Standort!");
		mv.addObject("message", "Hier finden sie uns");
		mv.setViewName("open/kontakt");
		return mv;
	}
	
	@RequestMapping(value="/team.html")
	public ModelAndView team() {
		Log.info("team");
		ModelAndView mv = new ModelAndView();
		mv.addObject("title", "Projektteam");
		mv.setViewName("open/team");
		return mv;
	}

}
